const app = getApp();
const Controller = require('../controllers/controllers.js').controller;
Page({
    data: {
        banner: [],
        navHeight: '',
        page: 1,
        pageSize: 10,
        isEnd: false,
        contentlistdata: [],
        isloading: true,
        type: 1,
        indexBtnInfodata: '',
    },
    onLoad(options) {
        this.getBanner()
    },
    onShow() {

    },
    onReady(){
    this.setData({
        headerHeight:app.globalData.headerHeight
    })
    },
    //轮播图切换
    change(e) {

    },
    getBanner() {
        Controller.bannerList({ source: 2 }).then(res => {
            this.setData({
                banner: res.data.baseData
            })
        })
    },
    onShareAppMessage: function(e) {
        let title = '百乐旗高端瑜伽运动品牌，全新登场!';
        let imageUrl = '../../images/share_home.jpg';
        let path = app.getCurrentPageUrlWithArgs()
        let obj = {
            title,
            imageUrl,
            path,
            success: function(res) {},
            fail(err) {}
        }
        return obj
    },
    onShareTimeline: function(res) {
        let title = '';
        let imageUrl = '';
        let path = app.getCurrentPageUrlWithArgs()
        let obj = {
            title,
            imageUrl,
            path,
            success: function(res) {},
            fail(err) {}
        }
        return obj
    },


})